<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/web/header.jsp"%>
<title>登陆</title>
</head>
<body>
	<fieldset class="layui-elem-field" style="margin: 20px; padding: 20px;">
		<legend>登陆</legend>
		<div class="layui-field-box">
			<form class="layui-form layui-form-pane" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">工号</label>
					<div class="layui-input-inline">
						<input type="text" name="code" class="layui-input"
							lay-verify="required" placeholder="请输入工号" />
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">密码</label>
					<div class="layui-input-inline">
						<input type="password" name="password" class="layui-input"
							lay-verify="required" placeholder="请输入密码" />
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-inline">
						<input type="button" value="登陆" class="layui-btn" lay-submit
							lay-filter="login" /> <input type="reset" value="重置"
							class="layui-btn layui-btn-primary" />
					</div>
					<input type="button" class="layui-btn" value="注册"
						onclick="goJspRegister()" />
				</div>
				<input type="hidden" name="action" value="login" />
			</form>
		</div>
	</fieldset>
	<script type="text/javascript">


formSubmit('/StaffServlet','submit(login)','text',function(data){
	        if(data == 1){
				layer.msg("登陆成功")
				location.href="<%=app%>/web/page/index.jsp";
			} else if (data == 2) {
				layer.msg("密码错误")
			} else {
				layer.msg("工号错误")
			}
		});
	</script>
</body>
</html>